home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3 / f90 / maxval.z / maxval
Encoding:
Text File  |  1998-10-30  |  5.7 KB  |  124 lines

  1. MAXVAL(3I)                                             Last changed: 1-6-98
  2.  
  3.  
  4. NNAAMMEE
  5.      MMAAXXVVAALL - Returns the maximum value in an array
  6.  
  7. SSYYNNOOPPSSIISS
  8.      MMAAXXVVAALL (([AARRRRAAYY==]_a_r_r_a_y [,,[DDIIMM==]_d_i_m] [,,[MMAASSKK==]_m_a_s_k]))
  9.  
  10.      MMAAXXVVAALL (([AARRRRAAYY==]_a_r_r_a_y [,,[MMAASSKK==]_m_a_s_k]))
  11.  
  12. IIMMPPLLEEMMEENNTTAATTIIOONN
  13.      UNICOS, UNICOS/mk, and IRIX systems
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      Fortran 90
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      The MMAAXXVVAALL intrinsic function can be used for array reduction.  It
  20.      returns the maximum value of the elements of _a_r_r_a_y along dimension _d_i_m
  21.      corresponding to the true elements of _m_a_s_k.  It accepts the following
  22.      arguments:
  23.  
  24.      _a_r_r_a_y     Must be of type integer or real.  It must not be scalar.
  25.  
  26.      _d_i_m       Must be a scalar integer value in the range 1 <= _d_i_m <= _n,
  27.                where _n is the rank of _a_r_r_a_y.  The corresponding actual
  28.                argument must not be an optional dummy argument.  This
  29.                function does a check on _d_i_m when present.
  30.  
  31.      _m_a_s_k      This optional argument must be of type logical and must be
  32.                conformable with _a_r_r_a_y.
  33.  
  34.      MMAAXXVVAALL is a transformational intrinsic function.  The name of this
  35.      intrinsic cannot be passed as an argument.
  36.  
  37. NNOOTTEESS
  38.      On UNICOS systems, both execution speed and the number of bits used in
  39.      mathematical operations are affected when compiling with
  40.      ff9900 --OO ffaassttiinntt, which is the default setting.  For more information,
  41.      see _C_F_9_0 _C_o_m_m_a_n_d_s _a_n_d _D_i_r_e_c_t_i_v_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-
  42.      3901.
  43.  
  44. RREETTUURRNN VVAALLUUEESS
  45.      The result is of the same type as _a_r_r_a_y.  It is scalar if _d_i_m is
  46.      absent or _a_r_r_a_y has rank one.  Otherwise, the result is an array of
  47.      rank _n-1 and of shape
  48.      (_d , _d , ..., _d     , _d     , ..., _d ),
  49.        1   2        _d_i_m-1   _d_i_m+1        _n
  50.      where (_d , _d , ..., _d )
  51.              1   2        _n
  52.      is the shape of _a_r_r_a_y.
  53.  
  54.      The result of MMAAXXVVAALL((_a_r_r_a_y)) has a value equal to the maximum value of
  55.      all the elements of _a_r_r_a_y or has the value of the negative number of
  56.      the largest magnitude supported for numbers of the data type of _a_r_r_a_y
  57.      if _a_r_r_a_y is a zero-sized array.
  58.  
  59.      The result of MMAAXXVVAALL((_a_r_r_a_y,,MMAASSKK==_m_a_s_k) has a value equal to the maximum
  60.      value of all the elements of _a_r_r_a_y corresponding to true elements of
  61.      _m_a_s_k or has the value of the negative number of the largest magnitude
  62.      supported for numbers of the data type of _a_r_r_a_y if there are no true
  63.      elements.
  64.  
  65.      If _a_r_r_a_y has rank one, MMAAXXVVAALL(_a_r_r_a_y,_d_i_m[,,_m_a_s_k]) has a value equal to
  66.      that of MMAAXXVVAALL(_a_r_r_a_y[,,MMAASSKK=_m_a_s_k]).  Otherwise, the value of element
  67.      (_s , _s , ..., _s     , _s     , ..., _s )
  68.        1   2        _d_i_m-1   _d_i_m+1        _n
  69.      of MMAAXXVVAALL(_a_r_r_a_y,_d_i_m[,,_m_a_s_k]) is equal to
  70.      MMAAXXVVAALL(_a_r_r_a_y(_s , _s , ..., _s     , : , _s     , ..., _s )
  71.                    1   2        _d_i_m-1       _d_i_m+1        _n
  72.       [,, MMAASSKK==_m_a_s_k((_s , _s , ..., _s     , : , _s     , ..., _s )]).
  73.                     1   2        _d_i_m-1       _d_i_m+1        _n
  74.  
  75.      On UNICOS and UNICOS/mk systems, MMAAXXVVAALL returns the value of
  76.      --HHUUGGEE((_a_r_r_a_y)) for all zero-sized arrays.  On IRIX systems, MMAAXXVVAALL
  77.      returns the value of --IINNFFIINNIITTYY for real, zero-sized arrays.  A request
  78.      for interpretation of the Fortran 90 standard may change one of these
  79.      return values for a real array in a future release.
  80.  
  81. EEXXAAMMPPLLEESS
  82.      Example 1:  The value of MMAAXXVVAALL(( ((// 11,, 22,, 33 //)) )) is 3.
  83.  
  84.      Example 2:  Assume that C is the array [10,-100,10].  Then
  85.      MMAAXXVVAALL((CC,, MMAASSKK==CC ..LLTT.. 00..00)) finds the maximum of the negative elements
  86.      of C (which is -100) and MMAAXXVVAALL((CC,, MMAASSKK==CC ..GGTT.. 1100)) returns a negative
  87.      number of the largest possible integer because there are no true
  88.      elements using the mask.
  89.  
  90.      Example 3:  Assume that BB is the following array:
  91.  
  92.         | 1 3 5 |
  93.  
  94.         | 2 4 6 |
  95.  
  96.      The following are true:
  97.  
  98.           MMAAXXVVAALL((BB,, DDIIMM==11)) is [2, 4, 6]
  99.  
  100.           MMAAXXVVAALL((BB,, DDIIMM==22)) is [5, 6]
  101.  
  102.           MMAAXXVVAALL((BB)) is 6
  103.  
  104.      Example 4:  Assume that NN is the following array:
  105.  
  106.         | 0 1 2 3 |
  107.  
  108.         | 4 5 6 7 |
  109.  
  110.         | 8 9 0 1 |
  111.  
  112.      The following are true:
  113.  
  114.           MMAAXXVVAALL((NN((22::33,,22::44)),,MMAASSKK==NN((22::33,,22::44))..NNEE..00)) is 9
  115.  
  116.           MMAAXXVVAALL((NN((22::33,,22::44)),,DDIIMM==11,,NN((22::33,,22::44))..NNEE..00)) is [9, 6, 7]
  117.  
  118.           MMAAXXVVAALL((NN((22::33,,22::44)),,DDIIMM==22,,NN((22::33,,22::44))..NNEE..00)) is [7, 9]
  119.  
  120. SSEEEE AALLSSOO
  121.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
  122.      printed version of this man page.
  123.  
  124.